package cn.doitedu.web.controller;

import cn.doitedu.web.pojo.Person;
import cn.doitedu.web.pojo.Term;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {


    @RequestMapping("/aaa")
    //@ResponseBody
    public String hello(){
        return "ok";
    }

    @RequestMapping("/bbb")
    //@ResponseBody
    public String hi(){

        return "hi";
    }

    @RequestMapping("/sum")
    //@ResponseBody
    public String add(int a,int b){

        return (a+b)+"";
    }

    @RequestMapping("/max")
    public String max(int a,int b,int c){

        int tmp = a>b?a:b;
        int res = tmp>c?tmp:c;


        return res+"";
    }


    @RequestMapping("/query/person")
    public Person queryPerson(String name){

        Term term = new Term("50期", "涛哥");

        Person person = new Person(name, RandomUtils.nextInt(10, 60), "male", term);

        return person;
    }

}
